<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>代理商列表</title>
    <meta name="decorator" content="default"/>
    <style type="text/css"> /*<![CDATA[*/ .black{color:#000;} .gray{color:#FF0000;}</style>
    <script type="text/javascript">
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").attr("action", "${ctx}/sys/agent/queryAgentList");
            $("#searchForm").submit();
            return false;
        }

        function changeStatus(obj) {
            var thisStatus = $(obj).text();
            var agentId = $(obj).parent().parent().children().first().text();
            location.href ="/a/sys/agent/updateAgentStatus?id="+agentId;
        }
    </script>

</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sys/agent/queryAgentList">代理商列表</a></li>
</ul>

<form:form id="searchForm" class="breadcrumb form-search" action="/a/sys/agent/queryAgentList"
     modelAttribute="userAgent"  method="post">
    <input id="pageNo" name="pageNo" type="hidden" value="1"/>
    <input id="pageSize" name="pageSize" type="hidden" value="30"/>
    <label> 名称: </label>
    <input id="name" name="name" value="${userAgent.name}" type="text" maxlength="50"
           class="input-medium"/>
    <label> 代理市: </label>
    <input id="citys" name="citys" value="${userAgent.citys}" type="text" maxlength="50"
           class="input-medium"/>
		<span style="margin-top:8px;">
			<%--<label>日期范围：&nbsp;</label>--%>
			<%--<input id="beginDate" style="width: 120px;" name="beginDate" type="text" readonly="readonly" maxlength="20"--%>
                   <%--class="input-mini Wdate" value="${userAgent.beginDate}"--%>
                   <%--onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>--%>
			<%--<label>&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>--%>
			<%--<input id="endDate" style="width: 120px;" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"--%>
                   <%--value="${userAgent.endDate}"--%>
                   <%--onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;&nbsp;--%>
			&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
		</span>
</form:form>

<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>代理商名称</th>
        <th>登陆账号</th>
        <th>代理区域</th>
        <th>代理商余额</th>
     <%--   <th>头像</th>--%>
        <th>联系电话</th>
    <%--    <th>注册时间</th>--%>
        <th>操作</th>
    </thead>
    <tbody>
    <c:forEach items="${userAgentPage.list}" var="userAgent">
        <tr>
            <td  style="display:none;">${userAgent.id}</td>

            <td> ${userAgent.name}</td>
            <td> ${userAgent.loginName}</td>
            <td> ${userAgent.oldLoginName}</td>
            <td> ${userAgent.email}</td>
           <%-- <td> ${userAgent.photo}</td>--%>
            <td> ${userAgent.mobile}</td>
           <%-- <c:set var="now" value="<%=new java.util.Date()%>" />--%>
           <%-- <td> <fmt:formatDate type="both"
                                 dateStyle="medium" timeStyle="medium"
                                 value="${userAgent.createTime}" /></td>
            <td>--%>
            <td>
            <span onclick="changeStatus(this)"  >
            <c:if test="${userAgent.activeFlag eq '0'}">
                <a color ="red">激活</a>
            </c:if>
            <c:if test="${userAgent.activeFlag eq '1'}">
                <a color ="red">停用</a>
            </c:if>
            </span>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${userAgentPage}</div>
</body>
</html>